$(function(){
	var admin_id = getCookie('admin_id');
	if(!admin_id){
		window.location.replace('login.html');
	}
	list_value();
});
function list_value(page){
	if(!page){
		//获取店员列表
	    $.ajax({
			url: ApiUrl + "/setting?limit="+Page,
	        type: 'get',
	        dataType: 'JSON',
	        success: function(result) {
	        	if(result.code == 200){
	        		var html='';
	        		$.each(result.data, function(k, v) {
	        			html+='<tr>'
	                            +'<td>'+v.id+'</td>'
	                            +'<td>'+v.name+'</td>';
                       html+='<td>'+v.created_at+'</td>'
	                            +'<td><a title = "编辑设置"  href="config_edit.html?id='+v.id+'" class="btn btn-primary btn-circle"><i class="fa fa-list"></i></a>';
	        		});
	        		$("#value").html(html);
	        	}else{
		    		parent.layer.msg(result.message);
		    		return false;
		    	}
	        }
	    });
	}else{
		//$("#value").empty();
		//获取店员列表
	    $.ajax({
			url: ApiUrl + "/setting?limit="+Page+"&page="+page,
	        type: 'get',
	        dataType: 'JSON',
	        success: function(result) {
	        	if(result.code == 200){
	        		var html='';
	        		$.each(result.data, function(k, v) {
	        			html+='<tr>'
	                            +'<td>'+v.id+'</td>'
	                            +'<td>'+v.name+'</td>';
	                            
                       html+='<td>'+v.created_at+'</td>'
	                            +'<td><a title = "编辑商品"  href="goods_edit.html?id='+v.goods_id+'" class="btn btn-primary btn-circle"><i class="fa fa-list"></i></a>';
	        		});
	        		$("#value").html(html);
	        	}else{
		    		parent.layer.msg(result.message);
		    		return false;
		    	}
	        }
	    });
	}
	
}